package br.patrimonio.inventario.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import org.hibernate.annotations.Index;

import br.patrimonio.inventario.converter.BaseEntity;

@Entity
public class Unidade implements Serializable, BaseEntity {
	
	private static final long serialVersionUID = 1L;

	@Id
	@Index(name="unid_id")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="unid_id")
	private Long id;
	
	@Index(name="unid_nome")
	@Column(name="unid_nome")
	private String nome;
	
	@Index(name="unid_sigla")
	@Column(name="unid_sigla")
	private String sigla;

	//Getters and Setter
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome.toUpperCase();
	}

	public String getSigla() {
		return sigla;
	}

	public void setSigla(String sigla) {
		this.sigla = sigla.toUpperCase();
	}
}
